package com.yimils.core.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yimils.core.sys.vo.UserRoleVo;
import com.yimils.core.sys.vo.UserMenuVo;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

/**
 * 公司平台账号
 */
@Data
@TableName("user")
public class UserEntity {
    @TableId(type = IdType.AUTO)
    private Long id;

    private String name;

    private String mobile;

    private String email;

    private String nick;

    private Integer gender;

    private String password;

    private String salt;

    private Long balance;

    private Long superiorId;

    private Long deptId;

    private String unionId;

    private String inviteCode;

    @TableField(exist = false)
    private List<UserRoleVo> roles;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    private Integer active;

    @TableField(exist = false)
    @JsonIgnore
    private UserMenuVo userMenu;

    @TableField(exist = false)
    @JsonIgnore
    private Set<String> permissions;
}
